package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PostManageMapper;
import com.ruoyi.system.domain.PostManage;
import com.ruoyi.system.service.IPostManageService;

/**
 * 主贴Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-07-24
 */
@Service
public class PostManageServiceImpl implements IPostManageService 
{
    @Autowired
    private PostManageMapper postManageMapper;

    /**
     * 查询主贴
     * 
     * @param id 主贴主键
     * @return 主贴
     */
    @Override
    public PostManage selectPostManageById(Long id)
    {
        return postManageMapper.selectPostManageById(id);
    }

    /**
     * 查询主贴列表
     * 
     * @param postManage 主贴
     * @return 主贴
     */
    @Override
    public List<PostManage> selectPostManageList(PostManage postManage)
    {
        return postManageMapper.selectPostManageList(postManage);
    }

    /**
     * 新增主贴
     * 
     * @param postManage 主贴
     * @return 结果
     */
    @Override
    public int insertPostManage(PostManage postManage)
    {
        postManage.setCreateTime(DateUtils.getNowDate());
        return postManageMapper.insertPostManage(postManage);
    }

    /**
     * 修改主贴
     * 
     * @param postManage 主贴
     * @return 结果
     */
    @Override
    public int updatePostManage(PostManage postManage)
    {
        postManage.setUpdateTime(DateUtils.getNowDate());
        return postManageMapper.updatePostManage(postManage);
    }

    /**
     * 批量删除主贴
     * 
     * @param ids 需要删除的主贴主键
     * @return 结果
     */
    @Override
    public int deletePostManageByIds(Long[] ids)
    {
        return postManageMapper.deletePostManageByIds(ids);
    }

    /**
     * 删除主贴信息
     * 
     * @param id 主贴主键
     * @return 结果
     */
    @Override
    public int deletePostManageById(Long id)
    {
        return postManageMapper.deletePostManageById(id);
    }
}
